<template>
  <el-pagination
    :current-page="currentPage"
    :page-sizes="sizes"
    :page-size="pageSize"
    layout="total, sizes, prev, pager, next, jumper"
    :total="total"
    @size-change="emitSizeChange"
    @current-change="emitCurrentChange"
  />
</template>

<script>
export default {
  props: {
    currentPage: {
      type: Number,
      default: 0
    },
    pageSize: {
      type: Number,
      default: 0
    },
    total: {
      type: Number,
      default: 0
    }
  },
  data() {
    return {
      sizes: [10, 20, 30, 40]
    }
  },
  methods: {
    emitSizeChange(val) {
      console.log('size变化：', val)
      this.$emit('size-change', val)
    },
    emitCurrentChange(val) {
      console.log('页码变化：', val)
      this.$emit('current-change', val)
    }
  }
}
</script>
